package com.galen.wxRead.mapper;

import com.galen.wxRead.domain.ReadInfo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 阅读链接Mapper接口
 * 
 * @author ruoyi
 * @date 2021-11-12
 */
@Mapper
public interface ReadInfoMapper 
{
    /**
     * 查询阅读链接
     * 
     * @param id 阅读链接ID
     * @return 阅读链接
     */
    public ReadInfo selectReadInfoById(Long id);

    public ReadInfo selectReadInfoByUrl(String url);

    @Delete("delete from read_info where state = 2")
    public void deleteAll();

    @Delete("delete from read_info where id = #{id}")
    public void deleteById(long id);

    /**
     * 查询阅读链接列表
     * 
     * @param readInfo 阅读链接
     * @return 阅读链接集合
     */
    public List<ReadInfo> selectReadInfoList(ReadInfo readInfo);

    public List<ReadInfo> selectReadInfoLimit(ReadInfo readInfo);

    /**
     * 新增阅读链接
     * 
     * @param readInfo 阅读链接
     * @return 结果
     */
    public Integer insertReadInfo(ReadInfo readInfo);

    public int updateReadInfoByUrl(ReadInfo readInfo);

    public int updateReadInfo(ReadInfo readInfo);
}
